deploy: Change BootLoaderSpec filenames so they can be used for sorting
authorJavier Martinez Canillas <javierm@redhat.com>
Wed, 27 Jun 2018 14:45:43 +0000 (16:45 +0200)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 27 Jun 2018 18:08:28 +0000 (18:08 +0000)
commit9f48e212a3bf9ed418fb3216e4f834d581bc520e
tree33071ba391bb20ac95afae57c2e6d1001ba65ed6
parent47ae4f5c7e9ed72b79b39df71b620bf6ace2b88a
deploy: Change BootLoaderSpec filenames so they can be used for sorting

Currently the BLS snippets are named ostree-$ID-$VARIANT_ID-$index.conf,
but the BLS config files are actually sorted by using the version field
which is the inverse of the index.

In most places, _ostree_sysroot_read_boot_loader_configs() is used to
get the BLS files and this function already returns them sorted by the
version field. The only place where the index trailing number is used is
in the ostree-grub-generator script that lists the BLS files to populate
the grub config file.

But for some bootloaders the BLS filename is the criteria for sorting by
taking the filename as a string version. So on these bootloaders the BLS
entries will be listed in the reverse order.

To avoid that, change the BLS snippets filename to have the version field
instead of the index and also to have the version before deployment name.

Make the filenames to be of the form ostree-$version-$ID-$VARIANT_ID.conf
so the version is before the deployment name.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Closes: #1654
Approved by: cgwalters
src/boot/grub2/ostree-grub-generator
src/libostree/ostree-sysroot-deploy.c
tests/admin-test.sh
tests/test-admin-deploy-2.sh
tests/test-admin-deploy-karg.sh
tests/test-admin-deploy-syslinux.sh
tests/test-admin-instutil-set-kargs.sh
tests/test-admin-pull-deploy-split.sh
tests/test-admin-upgrade-endoflife.sh
tests/test-no-initramfs.sh